<template>
  <router-view></router-view>
</template>

<script lang="ts" setup>
import { useStore } from "vuex";
import { getCookie } from "./utils/cookie";
// 线上禁用调试
// if (document.location.host == "www.gzbimai.com") {
//   (() => {
//     function block() {
//       if (
//         window.outerHeight - window.innerHeight > 200 ||
//         window.outerWidth - window.innerWidth > 200
//       ) {
//         document.body.innerHTML = "检测到非法调试，请关闭后刷新重试！";
//       }
//       setInterval(() => {
//         (function () {
//           return false;
//         }
//           ["constructor"]("debugger")
//           ["call"]());
//       }, 50);
//     }
//     try {
//       block();
//     } catch (err) {}
//   })();
// }
const store = useStore();
if (store.state.enterprise_id != getCookie("enterprise_id")) {
  store.commit("set_enterprise_id", getCookie("enterprise_id"));
}
const saveState = () => {
  console.log("刷新");
  store.commit("clear_tabs_list");
  store.commit("clear_customForm_role_list");
  store.commit("clear_condition_setup_list");
  sessionStorage.setItem("state", JSON.stringify(store.state));
};
window.addEventListener("unload", saveState);
</script>

<style lang="scss">
html {
  width: 100% !important;
  height: 100% !important;
  color: #333;
}
body {
  width: 100% !important;
  height: 100% !important;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  font-size: 14px;
  height: 100%;
}
.container {
  position: relative;
}
.pagination {
  position: absolute;
  bottom: 0;
  left: 20px;
  width: 100%;
}
</style>
